package com.example.sourcesprng.jdk8._lambda._supplier;

import java.util.Arrays;
import java.util.function.Supplier;

public class SupperTest {

    public static void main(String[] args) {
        supperTest(() -> {
            Integer[] ints = {1, 2, 3, 4, 5};
            Arrays.sort(ints);
            return ints[ints.length - 1];
        });
    }


    public static void supperTest(Supplier<Integer> supplier) {
        int max = supplier.get();
        System.out.println("最大值为：" + max);
    }
}
